Repository navigation
feat(sessions): support call disclosure configuration - #13
Merged
Merged
Conversation
…y set Accept ai_disclosure "off" client-side; the server rejects it for managed users with 400 and allows it for test accounts. Unknown values, None and non-strings are still refused before any request. Disclosure update tests now parse a realistic server response instead of the mock's echo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ai_disclosure takes disabled|on_request|proactive and recording_disclosure takes disabled|proactive, replacing "off" and the boolean. Updates accept only known strings; SessionConfig reads both as plain strings so a mode added by the server still parses. Docs describe test-account defaults, note that older servers may accept these settings without applying them, and the update_config docstring groups caller ID and disclosures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match the SDK's partial-update convention: None leaves a session setting unchanged and is not sent, replacing the private sentinel; a call with nothing to change still raises ValueError before any request. Response disclosure fields use plain str. Docs note that a 500 means the change was not saved, and the changelog says caller_id is no longer required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK offers ai_disclosure and caller_id only. Remove recording_disclosure from update_config() and SessionConfig, drop the RecordingDisclosure type, and remove it from the docs and changelog. SessionConfig still allows extra fields, so a server response that carries recording_disclosure still parses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ponses The server still returns recording_disclosure, and SessionConfig allows extra fields, so it surfaced as an untyped attribute and in model_dump(). Drop the key before validation so the SDK never exposes it; other extra fields are unchanged. Also rewrap a paragraph in docs/sdk-api.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…deled Drop the response filter and its test so the SDK carries no code for settings it does not offer; SessionConfig keeps main's handling of extra fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Managed-user sessions need to choose how the agent discloses that it is an AI.
sessions.update_config()on the sync and async clients gainsai_disclosure("disabled","on_request"or"proactive"), the engine's own values.caller_idis no longer required, and each setting can be updated on its own.Noneleaves a setting unchanged, as inmanaged_users.update(). A call with nothing to change, an unknown value, or a non-string value fails before any request. The server decides which user may set which value: managed users get a 400 forai_disclosure="disabled".SessionConfig.ai_disclosureexposes the server's effective value as a plain string, so a mode added later still parses, and it isNonewhen an older server omits it. The SDK and HTTP references document the defaults: managed usersproactive, Pine test accountsdisabled. They also document that settings apply to the next calls, that 503session_config_push_failedmeans saved but not delivered while a 500 normally means not saved (if unsure, callget_config()or send the same value again), and that these settings require a server with session disclosure support.Validation:
ruff check src testspasses, and the offline suite (PYTHONPATH=src pytest tests/ --ignore=tests/integration, 317 passed) andgit diff --checkpass. Live integration tests were not run because they need credentials and spend credits.Deployment dependency: use these arguments only after the Pine server supports session disclosure settings. On an older server, managed users get a 400 and test accounts may see the setting accepted without effect. This change does not publish a package release.
🤖 Generated with Claude Code